<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qtextformat.cpp -->
  <title>QTextCharFormat Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QTextCharFormat</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTextCharFormat Class</h1>
<!-- $$$QTextCharFormat-brief -->
<p>The QTextCharFormat class provides formatting information for characters in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
<!-- @@@QTextCharFormat -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTextCharFormat&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qtextformat.html">QTextFormat</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qtextimageformat.html">QTextImageFormat</a> and <a href="qtexttablecellformat.html">QTextTableCellFormat</a></p>
</td></tr></table></div><ul>
<li><a href="qtextcharformat-members.html">List of all members, including inherited members</a></li>
<li><a href="qtextcharformat-obsolete.html">Obsolete members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are <a href="../qtdoc/threads-reentrancy.html">reentrant</a>.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#FontPropertiesInheritanceBehavior-enum">FontPropertiesInheritanceBehavior</a></b> { FontPropertiesSpecifiedOnly, FontPropertiesAll }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#UnderlineStyle-enum">UnderlineStyle</a></b> { NoUnderline, SingleUnderline, DashUnderline, DotLine, DashDotLine, &hellip;, SpellCheckUnderline }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#VerticalAlignment-enum">VerticalAlignment</a></b> { AlignNormal, AlignSuperScript, AlignSubScript, AlignMiddle, AlignBottom, &hellip;, AlignBaseline }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#QTextCharFormat">QTextCharFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#anchorHref">anchorHref</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#anchorNames">anchorNames</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#font">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont::Capitalization </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontCapitalization">fontCapitalization</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontFamilies">fontFamilies</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontFamily">fontFamily</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontFixedPitch">fontFixedPitch</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont::HintingPreference </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontHintingPreference">fontHintingPreference</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontItalic">fontItalic</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontKerning">fontKerning</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontLetterSpacing">fontLetterSpacing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont::SpacingType </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontLetterSpacingType">fontLetterSpacingType</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontOverline">fontOverline</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontPointSize">fontPointSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontStretch">fontStretch</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontStrikeOut">fontStrikeOut</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont::StyleHint </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontStyleHint">fontStyleHint</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontStyleName">fontStyleName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont::StyleStrategy </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontStyleStrategy">fontStyleStrategy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontUnderline">fontUnderline</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontWeight">fontWeight</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#fontWordSpacing">fontWordSpacing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#isAnchor">isAnchor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setAnchor">setAnchor</a></b>(bool <i>anchor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a></b>(const QString &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a></b>(const QStringList &amp;<i>names</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFont">setFont</a></b>(const QFont &amp;<i>font</i>, QTextCharFormat::FontPropertiesInheritanceBehavior <i>behavior</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFont-1">setFont</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontCapitalization">setFontCapitalization</a></b>(QFont::Capitalization <i>capitalization</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontFamilies">setFontFamilies</a></b>(const QStringList &amp;<i>families</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontFamily">setFontFamily</a></b>(const QString &amp;<i>family</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontFixedPitch">setFontFixedPitch</a></b>(bool <i>fixedPitch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontHintingPreference">setFontHintingPreference</a></b>(QFont::HintingPreference <i>hintingPreference</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontItalic">setFontItalic</a></b>(bool <i>italic</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontKerning">setFontKerning</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontLetterSpacing">setFontLetterSpacing</a></b>(qreal <i>spacing</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontLetterSpacingType">setFontLetterSpacingType</a></b>(QFont::SpacingType <i>letterSpacingType</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontOverline">setFontOverline</a></b>(bool <i>overline</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontPointSize">setFontPointSize</a></b>(qreal <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontStretch">setFontStretch</a></b>(int <i>factor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontStrikeOut">setFontStrikeOut</a></b>(bool <i>strikeOut</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontStyleHint">setFontStyleHint</a></b>(QFont::StyleHint <i>hint</i>, QFont::StyleStrategy <i>strategy</i> = QFont::PreferDefault)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontStyleName">setFontStyleName</a></b>(const QString &amp;<i>styleName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontStyleStrategy">setFontStyleStrategy</a></b>(QFont::StyleStrategy <i>strategy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontUnderline">setFontUnderline</a></b>(bool <i>underline</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontWeight">setFontWeight</a></b>(int <i>weight</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setFontWordSpacing">setFontWordSpacing</a></b>(qreal <i>spacing</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setTextOutline">setTextOutline</a></b>(const QPen &amp;<i>pen</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setToolTip">setToolTip</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setUnderlineColor">setUnderlineColor</a></b>(const QColor &amp;<i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setUnderlineStyle">setUnderlineStyle</a></b>(QTextCharFormat::UnderlineStyle <i>style</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#setVerticalAlignment">setVerticalAlignment</a></b>(QTextCharFormat::VerticalAlignment <i>alignment</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPen </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#textOutline">textOutline</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#toolTip">toolTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#underlineColor">underlineColor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat::UnderlineStyle </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#underlineStyle">underlineStyle</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat::VerticalAlignment </td><td class="memItemRight bottomAlign"><b><a href="qtextcharformat.html#verticalAlignment">verticalAlignment</a></b>() const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QTextCharFormat-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.</p>
<p>The font used can be set by supplying a font to the <a href="qtextcharformat.html#setFont">setFont</a>() function, and each aspect of its appearance can be adjusted to give the desired effect. <a href="qtextcharformat.html#setFontFamily">setFontFamily</a>() and <a href="qtextcharformat.html#setFontPointSize">setFontPointSize</a>() define the font's family (e.g&#x2e; Times) and printed size; <a href="qtextcharformat.html#setFontWeight">setFontWeight</a>() and <a href="qtextcharformat.html#setFontItalic">setFontItalic</a>() provide control over the style of the font. <a href="qtextcharformat.html#setFontUnderline">setFontUnderline</a>(), <a href="qtextcharformat.html#setFontOverline">setFontOverline</a>(), <a href="qtextcharformat.html#setFontStrikeOut">setFontStrikeOut</a>(), and <a href="qtextcharformat.html#setFontFixedPitch">setFontFixedPitch</a>() provide additional effects for text.</p>
<p>The color is set with <a href="qtextformat.html#setForeground">setForeground</a>(). If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with <a href="qtextcharformat.html#setAnchor">setAnchor</a>(). The <a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a>() and <a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a>() functions are used to specify the information about the hyperlink's destination and the anchor's name.</p>
</div>
<p><b>See also </b><a href="qtextformat.html">QTextFormat</a>, <a href="qtextblockformat.html">QTextBlockFormat</a>, <a href="qtexttableformat.html">QTextTableFormat</a>, and <a href="qtextlistformat.html">QTextListFormat</a>.</p>
<!-- @@@QTextCharFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$FontPropertiesInheritanceBehavior$$$FontPropertiesSpecifiedOnly$$$FontPropertiesAll -->
<h3 class="fn" id="FontPropertiesInheritanceBehavior-enum"><a name="FontPropertiesInheritanceBehavior-enum"></a>enum QTextCharFormat::<span class="name">FontPropertiesInheritanceBehavior</span></h3>
<p>This enum specifies how the <a href="qtextcharformat.html#setFont">setFont</a>() function should behave with respect to unset font properties.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTextCharFormat::FontPropertiesSpecifiedOnly</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">If a property is not explicitly set, do not change the text format's property value.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::FontPropertiesAll</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">If a property is not explicitly set, override the text format's property with a default value.</td></tr>
</table></div>
<p>This enum was introduced or modified in Qt 5.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@FontPropertiesInheritanceBehavior -->
<!-- $$$UnderlineStyle$$$NoUnderline$$$SingleUnderline$$$DashUnderline$$$DotLine$$$DashDotLine$$$DashDotDotLine$$$WaveUnderline$$$SpellCheckUnderline -->
<h3 class="fn" id="UnderlineStyle-enum"><a name="UnderlineStyle-enum"></a>enum QTextCharFormat::<span class="name">UnderlineStyle</span></h3>
<p>This enum describes the different ways drawing underlined text.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTextCharFormat::NoUnderline</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Text is draw without any underlining decoration.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::SingleUnderline</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">A line is drawn using <a href="../qtcore/qt.html#PenStyle-enum">Qt::SolidLine</a>.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::DashUnderline</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Dashes are drawn using <a href="../qtcore/qt.html#PenStyle-enum">Qt::DashLine</a>.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::DotLine</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Dots are drawn using <a href="../qtcore/qt.html#PenStyle-enum">Qt::DotLine</a>;</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::DashDotLine</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Dashs and dots are drawn using <a href="../qtcore/qt.html#PenStyle-enum">Qt::DashDotLine</a>.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::DashDotDotLine</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">Underlines draw drawn using <a href="../qtcore/qt.html#PenStyle-enum">Qt::DashDotDotLine</a>.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::WaveUnderline</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The text is underlined using a wave shaped line.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::SpellCheckUnderline</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">The underline is drawn depending on the SpellCheckUnderlineStyle theme hint of QPlatformTheme. By default this is mapped to WaveUnderline, on macOS it is mapped to DotLine.</td></tr>
</table></div>
<p><b>See also </b><a href="../qtcore/qt.html#PenStyle-enum">Qt::PenStyle</a>.</p>
<!-- @@@UnderlineStyle -->
<!-- $$$VerticalAlignment$$$AlignNormal$$$AlignSuperScript$$$AlignSubScript$$$AlignMiddle$$$AlignTop$$$AlignBottom$$$AlignBaseline -->
<h3 class="fn" id="VerticalAlignment-enum"><a name="VerticalAlignment-enum"></a>enum QTextCharFormat::<span class="name">VerticalAlignment</span></h3>
<p>This enum describes the ways that adjacent characters can be vertically aligned.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignNormal</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Adjacent characters are positioned in the standard way for text in the writing system in use.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignSuperScript</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Characters are placed above the base line for normal text.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignSubScript</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Characters are placed below the base line for normal text.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignMiddle</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The center of the object is vertically aligned with the base line. Currently, this is only implemented for inline objects.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignBottom</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The bottom edge of the object is vertically aligned with the base line.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignTop</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The top edge of the object is vertically aligned with the base line.</td></tr>
<tr><td class="topAlign"><code>QTextCharFormat::AlignBaseline</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The base lines of the characters are aligned.</td></tr>
</table></div>
<!-- @@@VerticalAlignment -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextCharFormat[overload1]$$$QTextCharFormat -->
<h3 class="fn" id="QTextCharFormat"><a name="QTextCharFormat"></a>QTextCharFormat::<span class="name">QTextCharFormat</span>()</h3>
<p>Constructs a new character format object.</p>
<!-- @@@QTextCharFormat -->
<!-- $$$anchorHref[overload1]$$$anchorHref -->
<h3 class="fn" id="anchorHref"><a name="anchorHref"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextCharFormat::<span class="name">anchorHref</span>() const</h3>
<p>Returns the text format's hypertext link, or an empty string if none has been set.</p>
<p><b>See also </b><a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a>().</p>
<!-- @@@anchorHref -->
<!-- $$$anchorNames[overload1]$$$anchorNames -->
<h3 class="fn" id="anchorNames"><a name="anchorNames"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QTextCharFormat::<span class="name">anchorNames</span>() const</h3>
<p>Returns the anchor names associated with this text format, or an empty string list if none has been set. If the anchor names are set, text with this format can be the destination of a hypertext link.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a>().</p>
<!-- @@@anchorNames -->
<!-- $$$font[overload1]$$$font -->
<h3 class="fn" id="font"><a name="font"></a><span class="type"><a href="qfont.html">QFont</a></span> QTextCharFormat::<span class="name">font</span>() const</h3>
<p>Returns the font for this character format.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@font -->
<!-- $$$fontCapitalization[overload1]$$$fontCapitalization -->
<h3 class="fn" id="fontCapitalization"><a name="fontCapitalization"></a><span class="type"><a href="qfont.html#Capitalization-enum">QFont::Capitalization</a></span> QTextCharFormat::<span class="name">fontCapitalization</span>() const</h3>
<p>Returns the current capitalization type of the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontCapitalization">setFontCapitalization</a>().</p>
<!-- @@@fontCapitalization -->
<!-- $$$fontFamilies[overload1]$$$fontFamilies -->
<h3 class="fn" id="fontFamilies"><a name="fontFamilies"></a><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTextCharFormat::<span class="name">fontFamilies</span>() const</h3>
<p>Returns the text format's font families.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontFamilies">setFontFamilies</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontFamilies -->
<!-- $$$fontFamily[overload1]$$$fontFamily -->
<h3 class="fn" id="fontFamily"><a name="fontFamily"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextCharFormat::<span class="name">fontFamily</span>() const</h3>
<p>Returns the text format's font family.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontFamily">setFontFamily</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontFamily -->
<!-- $$$fontFixedPitch[overload1]$$$fontFixedPitch -->
<h3 class="fn" id="fontFixedPitch"><a name="fontFixedPitch"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontFixedPitch</span>() const</h3>
<p>Returns <code>true</code> if the text format's font is fixed pitch; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontFixedPitch">setFontFixedPitch</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontFixedPitch -->
<!-- $$$fontHintingPreference[overload1]$$$fontHintingPreference -->
<h3 class="fn" id="fontHintingPreference"><a name="fontHintingPreference"></a><span class="type"><a href="qfont.html#HintingPreference-enum">QFont::HintingPreference</a></span> QTextCharFormat::<span class="name">fontHintingPreference</span>() const</h3>
<p>Returns the hinting preference set for this text format.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontHintingPreference">setFontHintingPreference</a>(), <a href="qtextcharformat.html#font">font</a>(), and <a href="qfont.html#hintingPreference">QFont::hintingPreference</a>().</p>
<!-- @@@fontHintingPreference -->
<!-- $$$fontItalic[overload1]$$$fontItalic -->
<h3 class="fn" id="fontItalic"><a name="fontItalic"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontItalic</span>() const</h3>
<p>Returns <code>true</code> if the text format's font is italic; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontItalic">setFontItalic</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontItalic -->
<!-- $$$fontKerning[overload1]$$$fontKerning -->
<h3 class="fn" id="fontKerning"><a name="fontKerning"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontKerning</span>() const</h3>
<p>Returns <code>true</code> if the font kerning is enabled.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontKerning">setFontKerning</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontKerning -->
<!-- $$$fontLetterSpacing[overload1]$$$fontLetterSpacing -->
<h3 class="fn" id="fontLetterSpacing"><a name="fontLetterSpacing"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextCharFormat::<span class="name">fontLetterSpacing</span>() const</h3>
<p>Returns the current letter spacing.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontLetterSpacing">setFontLetterSpacing</a>(), <a href="qtextcharformat.html#setFontLetterSpacingType">setFontLetterSpacingType</a>(), and <a href="qtextcharformat.html#fontLetterSpacingType">fontLetterSpacingType</a>().</p>
<!-- @@@fontLetterSpacing -->
<!-- $$$fontLetterSpacingType[overload1]$$$fontLetterSpacingType -->
<h3 class="fn" id="fontLetterSpacingType"><a name="fontLetterSpacingType"></a><span class="type"><a href="qfont.html#SpacingType-enum">QFont::SpacingType</a></span> QTextCharFormat::<span class="name">fontLetterSpacingType</span>() const</h3>
<p>Returns the letter spacing type of this format..</p>
<p>This function was introduced in Qt 5.0.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontLetterSpacingType">setFontLetterSpacingType</a>(), <a href="qtextcharformat.html#setFontLetterSpacing">setFontLetterSpacing</a>(), and <a href="qtextcharformat.html#fontLetterSpacing">fontLetterSpacing</a>().</p>
<!-- @@@fontLetterSpacingType -->
<!-- $$$fontOverline[overload1]$$$fontOverline -->
<h3 class="fn" id="fontOverline"><a name="fontOverline"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontOverline</span>() const</h3>
<p>Returns <code>true</code> if the text format's font is overlined; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontOverline">setFontOverline</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontOverline -->
<!-- $$$fontPointSize[overload1]$$$fontPointSize -->
<h3 class="fn" id="fontPointSize"><a name="fontPointSize"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextCharFormat::<span class="name">fontPointSize</span>() const</h3>
<p>Returns the font size used to display text in this format.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontPointSize">setFontPointSize</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontPointSize -->
<!-- $$$fontStretch[overload1]$$$fontStretch -->
<h3 class="fn" id="fontStretch"><a name="fontStretch"></a><span class="type">int</span> QTextCharFormat::<span class="name">fontStretch</span>() const</h3>
<p>Returns the current font stretching.</p>
<p>This function was introduced in Qt 5.0.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontStretch">setFontStretch</a>().</p>
<!-- @@@fontStretch -->
<!-- $$$fontStrikeOut[overload1]$$$fontStrikeOut -->
<h3 class="fn" id="fontStrikeOut"><a name="fontStrikeOut"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontStrikeOut</span>() const</h3>
<p>Returns <code>true</code> if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontStrikeOut">setFontStrikeOut</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontStrikeOut -->
<!-- $$$fontStyleHint[overload1]$$$fontStyleHint -->
<h3 class="fn" id="fontStyleHint"><a name="fontStyleHint"></a><span class="type"><a href="qfont.html#StyleHint-enum">QFont::StyleHint</a></span> QTextCharFormat::<span class="name">fontStyleHint</span>() const</h3>
<p>Returns the font style hint.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontStyleHint">setFontStyleHint</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontStyleHint -->
<!-- $$$fontStyleName[overload1]$$$fontStyleName -->
<h3 class="fn" id="fontStyleName"><a name="fontStyleName"></a><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTextCharFormat::<span class="name">fontStyleName</span>() const</h3>
<p>Returns the text format's font style name.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontStyleName">setFontStyleName</a>(), <a href="qtextcharformat.html#font">font</a>(), and <a href="qfont.html#styleName">QFont::styleName</a>().</p>
<!-- @@@fontStyleName -->
<!-- $$$fontStyleStrategy[overload1]$$$fontStyleStrategy -->
<h3 class="fn" id="fontStyleStrategy"><a name="fontStyleStrategy"></a><span class="type"><a href="qfont.html#StyleStrategy-enum">QFont::StyleStrategy</a></span> QTextCharFormat::<span class="name">fontStyleStrategy</span>() const</h3>
<p>Returns the current font style strategy.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontStyleStrategy">setFontStyleStrategy</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontStyleStrategy -->
<!-- $$$fontUnderline[overload1]$$$fontUnderline -->
<h3 class="fn" id="fontUnderline"><a name="fontUnderline"></a><span class="type">bool</span> QTextCharFormat::<span class="name">fontUnderline</span>() const</h3>
<p>Returns <code>true</code> if the text format's font is underlined; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontUnderline">setFontUnderline</a>() and <a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@fontUnderline -->
<!-- $$$fontWeight[overload1]$$$fontWeight -->
<h3 class="fn" id="fontWeight"><a name="fontWeight"></a><span class="type">int</span> QTextCharFormat::<span class="name">fontWeight</span>() const</h3>
<p>Returns the text format's font weight.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontWeight">setFontWeight</a>(), <a href="qtextcharformat.html#font">font</a>(), and <a href="qfont.html#Weight-enum">QFont::Weight</a>.</p>
<!-- @@@fontWeight -->
<!-- $$$fontWordSpacing[overload1]$$$fontWordSpacing -->
<h3 class="fn" id="fontWordSpacing"><a name="fontWordSpacing"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextCharFormat::<span class="name">fontWordSpacing</span>() const</h3>
<p>Returns the current word spacing value.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#setFontWordSpacing">setFontWordSpacing</a>().</p>
<!-- @@@fontWordSpacing -->
<!-- $$$isAnchor[overload1]$$$isAnchor -->
<h3 class="fn" id="isAnchor"><a name="isAnchor"></a><span class="type">bool</span> QTextCharFormat::<span class="name">isAnchor</span>() const</h3>
<p>Returns <code>true</code> if the text is formatted as an anchor; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextcharformat.html#setAnchor">setAnchor</a>(), <a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a>(), and <a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a>().</p>
<!-- @@@isAnchor -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QTextCharFormat::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if this character format is valid; otherwise returns false.</p>
<!-- @@@isValid -->
<!-- $$$setAnchor[overload1]$$$setAnchorbool -->
<h3 class="fn" id="setAnchor"><a name="setAnchor"></a><span class="type">void</span> QTextCharFormat::<span class="name">setAnchor</span>(<span class="type">bool</span> <i>anchor</i>)</h3>
<p>If <i>anchor</i> is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. (Anchors are hyperlinks which are often shown underlined and in a different color from plain text.)</p>
<p>The way the text is rendered is independent of whether or not the format has a valid anchor defined. Use <a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a>(), and optionally <a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a>() to create a hypertext link.</p>
<p><b>See also </b><a href="qtextcharformat.html#isAnchor">isAnchor</a>().</p>
<!-- @@@setAnchor -->
<!-- $$$setAnchorHref[overload1]$$$setAnchorHrefconstQString& -->
<h3 class="fn" id="setAnchorHref"><a name="setAnchorHref"></a><span class="type">void</span> QTextCharFormat::<span class="name">setAnchorHref</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>value</i>)</h3>
<p>Sets the hypertext link for the text format to the given <i>value</i>. This is typically a URL like &quot;http://example.com/index.html&quot;.</p>
<p>The anchor will be displayed with the <i>value</i> as its display text; if you want to display different text call <a href="qtextcharformat.html#setAnchorNames">setAnchorNames</a>().</p>
<p>To format the text as a hypertext link use <a href="qtextcharformat.html#setAnchor">setAnchor</a>().</p>
<p><b>See also </b><a href="qtextcharformat.html#anchorHref">anchorHref</a>().</p>
<!-- @@@setAnchorHref -->
<!-- $$$setAnchorNames[overload1]$$$setAnchorNamesconstQStringList& -->
<h3 class="fn" id="setAnchorNames"><a name="setAnchorNames"></a><span class="type">void</span> QTextCharFormat::<span class="name">setAnchorNames</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>names</i>)</h3>
<p>Sets the text format's anchor <i>names</i>. For the anchor to work as a hyperlink, the destination must be set with <a href="qtextcharformat.html#setAnchorHref">setAnchorHref</a>() and the anchor must be enabled with <a href="qtextcharformat.html#setAnchor">setAnchor</a>().</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#anchorNames">anchorNames</a>().</p>
<!-- @@@setAnchorNames -->
<!-- $$$setFont[overload1]$$$setFontconstQFont&QTextCharFormat::FontPropertiesInheritanceBehavior -->
<h3 class="fn" id="setFont"><a name="setFont"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFont</span>(const <span class="type"><a href="qfont.html">QFont</a></span> &amp;<i>font</i>, <span class="type"><a href="qtextcharformat.html#FontPropertiesInheritanceBehavior-enum">QTextCharFormat::FontPropertiesInheritanceBehavior</a></span> <i>behavior</i>)</h3>
<p>Sets the text format's <i>font</i>.</p>
<p>If <i>behavior</i> is <a href="qtextcharformat.html#FontPropertiesInheritanceBehavior-enum">QTextCharFormat::FontPropertiesAll</a>, the font property that has not been explicitly set is treated like as it were set with default value; If <i>behavior</i> is <a href="qtextcharformat.html#FontPropertiesInheritanceBehavior-enum">QTextCharFormat::FontPropertiesSpecifiedOnly</a>, the font property that has not been explicitly set is ignored and the respective property value remains unchanged.</p>
<p>This function was introduced in Qt 5.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@setFont -->
<!-- $$$setFont$$$setFontconstQFont& -->
<h3 class="fn" id="setFont-1"><a name="setFont-1"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFont</span>(const <span class="type"><a href="qfont.html">QFont</a></span> &amp;<i>font</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the text format's <i>font</i>.</p>
<p><b>See also </b><a href="qtextcharformat.html#font">font</a>().</p>
<!-- @@@setFont -->
<!-- $$$setFontCapitalization[overload1]$$$setFontCapitalizationQFont::Capitalization -->
<h3 class="fn" id="setFontCapitalization"><a name="setFontCapitalization"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontCapitalization</span>(<span class="type"><a href="qfont.html#Capitalization-enum">QFont::Capitalization</a></span> <i>capitalization</i>)</h3>
<p>Sets the capitalization of the text that apppears in this font to <i>capitalization</i>.</p>
<p>A font's capitalization makes the text appear in the selected capitalization mode.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontCapitalization">fontCapitalization</a>().</p>
<!-- @@@setFontCapitalization -->
<!-- $$$setFontFamilies[overload1]$$$setFontFamiliesconstQStringList& -->
<h3 class="fn" id="setFontFamilies"><a name="setFontFamilies"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontFamilies</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>families</i>)</h3>
<p>Sets the text format's font <i>families</i>.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontFamilies">fontFamilies</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontFamilies -->
<!-- $$$setFontFamily[overload1]$$$setFontFamilyconstQString& -->
<h3 class="fn" id="setFontFamily"><a name="setFontFamily"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontFamily</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>)</h3>
<p>Sets the text format's font <i>family</i>.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontFamily">fontFamily</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontFamily -->
<!-- $$$setFontFixedPitch[overload1]$$$setFontFixedPitchbool -->
<h3 class="fn" id="setFontFixedPitch"><a name="setFontFixedPitch"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontFixedPitch</span>(<span class="type">bool</span> <i>fixedPitch</i>)</h3>
<p>If <i>fixedPitch</i> is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontFixedPitch">fontFixedPitch</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontFixedPitch -->
<!-- $$$setFontHintingPreference[overload1]$$$setFontHintingPreferenceQFont::HintingPreference -->
<h3 class="fn" id="setFontHintingPreference"><a name="setFontHintingPreference"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontHintingPreference</span>(<span class="type"><a href="qfont.html#HintingPreference-enum">QFont::HintingPreference</a></span> <i>hintingPreference</i>)</h3>
<p>Sets the hinting preference of the text format's font to be <i>hintingPreference</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontHintingPreference">fontHintingPreference</a>(), <a href="qtextcharformat.html#setFont">setFont</a>(), and <a href="qfont.html#setHintingPreference">QFont::setHintingPreference</a>().</p>
<!-- @@@setFontHintingPreference -->
<!-- $$$setFontItalic[overload1]$$$setFontItalicbool -->
<h3 class="fn" id="setFontItalic"><a name="setFontItalic"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontItalic</span>(<span class="type">bool</span> <i>italic</i>)</h3>
<p>If <i>italic</i> is true, sets the text format's font to be italic; otherwise the font will be non-italic.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontItalic">fontItalic</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontItalic -->
<!-- $$$setFontKerning[overload1]$$$setFontKerningbool -->
<h3 class="fn" id="setFontKerning"><a name="setFontKerning"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontKerning</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>Enables kerning for this font if <i>enable</i> is true; otherwise disables it.</p>
<p>When kerning is enabled, glyph metrics do not add up anymore, even for Latin text. In other words, the assumption that width('a') + width('b') is equal to width(&quot;ab&quot;) is not neccesairly true.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontKerning">fontKerning</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontKerning -->
<!-- $$$setFontLetterSpacing[overload1]$$$setFontLetterSpacingqreal -->
<h3 class="fn" id="setFontLetterSpacing"><a name="setFontLetterSpacing"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontLetterSpacing</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i>)</h3>
<p>Sets the letter spacing of this format to the given <i>spacing</i>. The meaning of the value depends on the font letter spacing type.</p>
<p>For percentage spacing a value of 100 indicates default spacing; a value of 200 doubles the amount of space a letter takes.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontLetterSpacing">fontLetterSpacing</a>(), <a href="qtextcharformat.html#setFontLetterSpacingType">setFontLetterSpacingType</a>(), and <a href="qtextcharformat.html#fontLetterSpacingType">fontLetterSpacingType</a>().</p>
<!-- @@@setFontLetterSpacing -->
<!-- $$$setFontLetterSpacingType[overload1]$$$setFontLetterSpacingTypeQFont::SpacingType -->
<h3 class="fn" id="setFontLetterSpacingType"><a name="setFontLetterSpacingType"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontLetterSpacingType</span>(<span class="type"><a href="qfont.html#SpacingType-enum">QFont::SpacingType</a></span> <i>letterSpacingType</i>)</h3>
<p>Sets the letter spacing type of this format to <i>letterSpacingType</i>.</p>
<p>This function was introduced in Qt 5.0.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontLetterSpacingType">fontLetterSpacingType</a>(), <a href="qtextcharformat.html#setFontLetterSpacing">setFontLetterSpacing</a>(), and <a href="qtextcharformat.html#fontLetterSpacing">fontLetterSpacing</a>().</p>
<!-- @@@setFontLetterSpacingType -->
<!-- $$$setFontOverline[overload1]$$$setFontOverlinebool -->
<h3 class="fn" id="setFontOverline"><a name="setFontOverline"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontOverline</span>(<span class="type">bool</span> <i>overline</i>)</h3>
<p>If <i>overline</i> is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontOverline">fontOverline</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontOverline -->
<!-- $$$setFontPointSize[overload1]$$$setFontPointSizeqreal -->
<h3 class="fn" id="setFontPointSize"><a name="setFontPointSize"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontPointSize</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>size</i>)</h3>
<p>Sets the text format's font <i>size</i>.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontPointSize">fontPointSize</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontPointSize -->
<!-- $$$setFontStretch[overload1]$$$setFontStretchint -->
<h3 class="fn" id="setFontStretch"><a name="setFontStretch"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontStretch</span>(<span class="type">int</span> <i>factor</i>)</h3>
<p>Sets the stretch factor for the font to <i>factor</i>.</p>
<p>The stretch factor changes the width of all characters in the font by factor percent. For example, setting <i>factor</i> to 150 results in all characters in the font being 1.5 times (ie. 150%) wider. The default stretch factor is 100. The minimum stretch factor is 1, and the maximum stretch factor is 4000.</p>
<p>The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts.</p>
<p>This function was introduced in Qt 5.0.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontStretch">fontStretch</a>().</p>
<!-- @@@setFontStretch -->
<!-- $$$setFontStrikeOut[overload1]$$$setFontStrikeOutbool -->
<h3 class="fn" id="setFontStrikeOut"><a name="setFontStrikeOut"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontStrikeOut</span>(<span class="type">bool</span> <i>strikeOut</i>)</h3>
<p>If <i>strikeOut</i> is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontStrikeOut">fontStrikeOut</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontStrikeOut -->
<!-- $$$setFontStyleHint[overload1]$$$setFontStyleHintQFont::StyleHintQFont::StyleStrategy -->
<h3 class="fn" id="setFontStyleHint"><a name="setFontStyleHint"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontStyleHint</span>(<span class="type"><a href="qfont.html#StyleHint-enum">QFont::StyleHint</a></span> <i>hint</i>, <span class="type"><a href="qfont.html#StyleStrategy-enum">QFont::StyleStrategy</a></span> <i>strategy</i> = QFont::PreferDefault)</h3>
<p>Sets the font style <i>hint</i> and <i>strategy</i>.</p>
<p>Qt does not support style hints on X11 since this information is not provided by the window system.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontStyleHint">fontStyleHint</a>(), <a href="qtextcharformat.html#setFont">setFont</a>(), and <a href="qfont.html#setStyleHint">QFont::setStyleHint</a>().</p>
<!-- @@@setFontStyleHint -->
<!-- $$$setFontStyleName[overload1]$$$setFontStyleNameconstQString& -->
<h3 class="fn" id="setFontStyleName"><a name="setFontStyleName"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontStyleName</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>styleName</i>)</h3>
<p>Sets the text format's font <i>styleName</i>.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontStyleName">fontStyleName</a>(), <a href="qtextcharformat.html#setFont">setFont</a>(), and <a href="qfont.html#setStyleName">QFont::setStyleName</a>().</p>
<!-- @@@setFontStyleName -->
<!-- $$$setFontStyleStrategy[overload1]$$$setFontStyleStrategyQFont::StyleStrategy -->
<h3 class="fn" id="setFontStyleStrategy"><a name="setFontStyleStrategy"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontStyleStrategy</span>(<span class="type"><a href="qfont.html#StyleStrategy-enum">QFont::StyleStrategy</a></span> <i>strategy</i>)</h3>
<p>Sets the font style <i>strategy</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontStyleStrategy">fontStyleStrategy</a>(), <a href="qtextcharformat.html#setFont">setFont</a>(), and <a href="qfont.html#setStyleStrategy">QFont::setStyleStrategy</a>().</p>
<!-- @@@setFontStyleStrategy -->
<!-- $$$setFontUnderline[overload1]$$$setFontUnderlinebool -->
<h3 class="fn" id="setFontUnderline"><a name="setFontUnderline"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontUnderline</span>(<span class="type">bool</span> <i>underline</i>)</h3>
<p>If <i>underline</i> is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontUnderline">fontUnderline</a>() and <a href="qtextcharformat.html#setFont">setFont</a>().</p>
<!-- @@@setFontUnderline -->
<!-- $$$setFontWeight[overload1]$$$setFontWeightint -->
<h3 class="fn" id="setFontWeight"><a name="setFontWeight"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontWeight</span>(<span class="type">int</span> <i>weight</i>)</h3>
<p>Sets the text format's font weight to <i>weight</i>.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontWeight">fontWeight</a>(), <a href="qtextcharformat.html#setFont">setFont</a>(), and <a href="qfont.html#Weight-enum">QFont::Weight</a>.</p>
<!-- @@@setFontWeight -->
<!-- $$$setFontWordSpacing[overload1]$$$setFontWordSpacingqreal -->
<h3 class="fn" id="setFontWordSpacing"><a name="setFontWordSpacing"></a><span class="type">void</span> QTextCharFormat::<span class="name">setFontWordSpacing</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i>)</h3>
<p>Sets the word spacing of this format to the given <i>spacing</i>, in pixels.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextcharformat.html#fontWordSpacing">fontWordSpacing</a>().</p>
<!-- @@@setFontWordSpacing -->
<!-- $$$setTextOutline[overload1]$$$setTextOutlineconstQPen& -->
<h3 class="fn" id="setTextOutline"><a name="setTextOutline"></a><span class="type">void</span> QTextCharFormat::<span class="name">setTextOutline</span>(const <span class="type"><a href="qpen.html">QPen</a></span> &amp;<i>pen</i>)</h3>
<p>Sets the pen used to draw the outlines of characters to the given <i>pen</i>.</p>
<p><b>See also </b><a href="qtextcharformat.html#textOutline">textOutline</a>().</p>
<!-- @@@setTextOutline -->
<!-- $$$setToolTip[overload1]$$$setToolTipconstQString& -->
<h3 class="fn" id="setToolTip"><a name="setToolTip"></a><span class="type">void</span> QTextCharFormat::<span class="name">setToolTip</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Sets the tool tip for a fragment of text to the given <i>text</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#toolTip">toolTip</a>().</p>
<!-- @@@setToolTip -->
<!-- $$$setUnderlineColor[overload1]$$$setUnderlineColorconstQColor& -->
<h3 class="fn" id="setUnderlineColor"><a name="setUnderlineColor"></a><span class="type">void</span> QTextCharFormat::<span class="name">setUnderlineColor</span>(const <span class="type"><a href="qcolor.html">QColor</a></span> &amp;<i>color</i>)</h3>
<p>Sets the underline color used for the characters with this format to the <i>color</i> specified.</p>
<p><b>See also </b><a href="qtextcharformat.html#underlineColor">underlineColor</a>().</p>
<!-- @@@setUnderlineColor -->
<!-- $$$setUnderlineStyle[overload1]$$$setUnderlineStyleQTextCharFormat::UnderlineStyle -->
<h3 class="fn" id="setUnderlineStyle"><a name="setUnderlineStyle"></a><span class="type">void</span> QTextCharFormat::<span class="name">setUnderlineStyle</span>(<span class="type"><a href="qtextcharformat.html#UnderlineStyle-enum">QTextCharFormat::UnderlineStyle</a></span> <i>style</i>)</h3>
<p>Sets the style of underlining the text to <i>style</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextcharformat.html#underlineStyle">underlineStyle</a>().</p>
<!-- @@@setUnderlineStyle -->
<!-- $$$setVerticalAlignment[overload1]$$$setVerticalAlignmentQTextCharFormat::VerticalAlignment -->
<h3 class="fn" id="setVerticalAlignment"><a name="setVerticalAlignment"></a><span class="type">void</span> QTextCharFormat::<span class="name">setVerticalAlignment</span>(<span class="type"><a href="qtextcharformat.html#VerticalAlignment-enum">QTextCharFormat::VerticalAlignment</a></span> <i>alignment</i>)</h3>
<p>Sets the vertical alignment used for the characters with this format to the <i>alignment</i> specified.</p>
<p><b>See also </b><a href="qtextcharformat.html#verticalAlignment">verticalAlignment</a>().</p>
<!-- @@@setVerticalAlignment -->
<!-- $$$textOutline[overload1]$$$textOutline -->
<h3 class="fn" id="textOutline"><a name="textOutline"></a><span class="type"><a href="qpen.html">QPen</a></span> QTextCharFormat::<span class="name">textOutline</span>() const</h3>
<p>Returns the pen used to draw the outlines of characters in this format.</p>
<p><b>See also </b><a href="qtextcharformat.html#setTextOutline">setTextOutline</a>().</p>
<!-- @@@textOutline -->
<!-- $$$toolTip[overload1]$$$toolTip -->
<h3 class="fn" id="toolTip"><a name="toolTip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextCharFormat::<span class="name">toolTip</span>() const</h3>
<p>Returns the tool tip that is displayed for a fragment of text.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtextcharformat.html#setToolTip">setToolTip</a>().</p>
<!-- @@@toolTip -->
<!-- $$$underlineColor[overload1]$$$underlineColor -->
<h3 class="fn" id="underlineColor"><a name="underlineColor"></a><span class="type"><a href="qcolor.html">QColor</a></span> QTextCharFormat::<span class="name">underlineColor</span>() const</h3>
<p>Returns the color used to underline the characters with this format.</p>
<p><b>See also </b><a href="qtextcharformat.html#setUnderlineColor">setUnderlineColor</a>().</p>
<!-- @@@underlineColor -->
<!-- $$$underlineStyle[overload1]$$$underlineStyle -->
<h3 class="fn" id="underlineStyle"><a name="underlineStyle"></a><span class="type"><a href="qtextcharformat.html#UnderlineStyle-enum">QTextCharFormat::UnderlineStyle</a></span> QTextCharFormat::<span class="name">underlineStyle</span>() const</h3>
<p>Returns the style of underlining the text.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextcharformat.html#setUnderlineStyle">setUnderlineStyle</a>().</p>
<!-- @@@underlineStyle -->
<!-- $$$verticalAlignment[overload1]$$$verticalAlignment -->
<h3 class="fn" id="verticalAlignment"><a name="verticalAlignment"></a><span class="type"><a href="qtextcharformat.html#VerticalAlignment-enum">QTextCharFormat::VerticalAlignment</a></span> QTextCharFormat::<span class="name">verticalAlignment</span>() const</h3>
<p>Returns the vertical alignment used for characters with this format.</p>
<p><b>See also </b><a href="qtextcharformat.html#setVerticalAlignment">setVerticalAlignment</a>().</p>
<!-- @@@verticalAlignment -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
